//
//  BookcaseCellView.h
//  ebook
//
//  Created by 吴超飞 on 16/3/4.
//  Copyright © 2016年 Moton. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Book.h"
#import "DAProgressOverlayView.h"
#import "UIImageView+WebCache.h"
#import "Bookmark.h"

#define SpaceIn  MTScreenW * 0.05// 20//内部边距
#define SpaceOut MTScreenW * 0.05// 20//最两边的边距


#define ImageWidth (isIpad?(MTScreenW - SpaceIn*3 - SpaceOut*2)/4:(MTScreenW - SpaceIn*2 - SpaceOut*2)/3)
#define ImageHeight (ImageWidth)*1.3

@class BookcaseCellView;
@protocol BookcaseCellViewDelegate <NSObject>

-(void)bookcaseCellView:(BookcaseCellView *)cell deleteBtnClick:(UIButton *)btn;
-(void)bookcaseCellView:(BookcaseCellView *)cell longPressGestureRecognizer:(UIGestureRecognizer *)gr;
-(void)bookcaseCellView:(BookcaseCellView *)cell tapedWhileIsEdit:(BOOL)isEdit;

@end

@interface BookcaseCellView : UIView<UIGestureRecognizerDelegate>

@property (nonatomic,retain) UITapGestureRecognizer *tapGestureRecognizer;

@property (nonatomic,retain) UIImageView *coverImageview;
@property (nonatomic,retain) UILabel *booknameLabel;
@property (nonatomic,retain) UIButton *deleteBtn;
@property (nonatomic,retain) UIView *foreBgview;
@property (nonatomic,retain) UIImageView *bgView;
@property (nonatomic,retain) UILabel *readedPercentLabel;
@property (nonatomic,retain) UILabel *bookStatusLabel;
@property (nonatomic,retain) UIImageView *reImageView;

@property (nonatomic,retain) DAProgressOverlayView *progressView;

@property (nonatomic,retain) Book *book;

@property (nonatomic,weak) id<BookcaseCellViewDelegate> delegate;
//是否可删除状态
@property (nonatomic, assign) BOOL isCanDelete;

-(void)update:(Book*)book;

@end
